
//
//  ERBoard.m
//  EnjoyRunning
//
//  Created by ljm on 2017/4/18.
//  Copyright © 2017年 ljm. All rights reserved.
//

#import "ERBoard.h"

@implementation ERBoard
    
- (instancetype)initWithFrame:(CGRect)frame
    {
        self = [super initWithFrame:frame];
        if (self) {
//            self.backgroundColor = [UIColor whiteColor];
        }
        return self;
    }


- (void)drawRect:(CGRect)rect {

#pragma mark - 绘制圆形
    UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(kwidth * 0.2, kheight * 0.18, kwidth * 0.6, kwidth * 0.6)];
    
    /*
     *    线宽
     */
    path.lineWidth = 1.5f;
    
    /*
     *    设置线条颜色
     */
    [[UIColor whiteColor]setStroke];
    
    /*
     *    绘图
     */
    [path stroke];
    
    
#pragma mark - 绘制横线
    /*
     *    画直线
     */
    UIBezierPath *straightLine = [[UIBezierPath alloc]init];
    
    /*
     *    线宽
     */
    straightLine.lineWidth = 0.3f;
    
    /*
     *    笔尖位置
     */
    [straightLine moveToPoint:CGPointMake(kwidth * 0.1, kheight * 0.63)];
    
    /*
     *    画线
     */
    [straightLine addLineToPoint:CGPointMake(kwidth * 0.9, kheight * 0.63)];
    
    //设置线条颜色
//    [[UIColor redColor]setStroke];
    
    //绘制
    [straightLine stroke];
    
#pragma mark -- 画两条竖线
    /*
     *    上边的竖线
     */
    UIBezierPath *vertailUpLine = [[UIBezierPath alloc] init];
    vertailUpLine.lineWidth = 0.4f;
    [vertailUpLine moveToPoint:CGPointMake(kwidth * 0.5, kheight * 0.55)];
    [vertailUpLine addLineToPoint:CGPointMake(kwidth * 0.5, kheight * 0.6)];
    [vertailUpLine stroke];
    
    /*
     *    下边的竖线
     */
    UIBezierPath *vertailDownLine = [[UIBezierPath alloc] init];
    vertailDownLine.lineWidth = 0.4f;
    [vertailDownLine moveToPoint:CGPointMake(kwidth * 0.5, kheight * 0.66)];
    [vertailDownLine addLineToPoint:CGPointMake(kwidth  * 0.5, kheight * 0.71)];
    [vertailDownLine stroke];
    
}
    


@end
